MkDetailsBlock
Pymdownx-based details box.¶
Bases: MkBlock
__init__
¶
__init__(
content: str | list | MkNode | None = None,
*,
typ: AdmonitionTypeStr = "info",
expanded: bool | None = None,
title: str | None = None,
**kwargs: Any
)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
content
|
str | list | MkNode | None
|
Admonition content |
None
|
typ
|
AdmonitionTypeStr
|
Admonition type |
'info'
|
expanded
|
bool | None
|
Whether the details block should be expanded initially |
None
|
title
|
str | None
|
Optional Admonition title |
None
|
kwargs
|
Any
|
Keyword arguments passed to parent |
{}
|
Name | Children | Inherits |
---|---|---|
MkBlock mknodes.basenodes.mkblock PyMdown-based block. |
graph TD
94721308064640["mkdetailsblock.MkDetailsBlock"]
94721311698224["mkblock.MkBlock"]
94721311697232["mkcontainer.MkContainer"]
94721308848336["mknode.MkNode"]
94721311766592["node.Node"]
140564252373184["builtins.object"]
94721311698224 --> 94721308064640
94721311697232 --> 94721311698224
94721308848336 --> 94721311697232
94721311766592 --> 94721308848336
140564252373184 --> 94721311766592
/home/runner/work/mknodes/mknodes/mknodes/basenodes/mkdetailsblock/metadata.toml
[metadata]
icon = "octicon:info-16"
name = "MkDetailsBlock"
[requirements.extension."pymdownx.blocks.details"]
[examples.regular]
title = "Regular"
jinja = """
{{ "Different types." | MkDetailsBlock(typ="warning") }}
"""
[examples.collapsible]
title = "Collapsible and expandable"
jinja = """
{{ "MkDetailsBlocks can also be expanded." | MkDetailsBlock(expanded=True) }}
"""
[output.markdown]
template = """
{{ node.fence_boundary }} details{% if node.argument %}" | " ~ {{ node.argument }}{% endif %}
type: {{ node.typ }}
{% if node.expanded %} open: True
{% endif %}
{{ node.items | join }}
{{ node.fence_boundary }}
"""